3.715 \(\int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx\)

Optimal. Leaf size=115 \[ \frac{(B (n+2)+i A (2-n)) (c-i c \tan (e+f x))^n \text{Hypergeometric2F1}\left (2,n,n+1,\frac{1}{2} (1-i \tan (e+f x))\right )}{16 a^2 f n}+\frac{(-B+i A) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2} \]

[Out]

((I*A*(2 - n) + B*(2 + n))*Hypergeometric2F1[2, n, 1 + n, (1 - I*Tan[e + f*x])/2]*(c - I*c*Tan[e + f*x])^n)/(1
6*a^2*f*n) + ((I*A - B)*(c - I*c*Tan[e + f*x])^n)/(4*a^2*f*(1 + I*Tan[e + f*x])^2)

________________________________________________________________________________________

Rubi [A]  time = 0.17342, antiderivative size = 115, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.073, Rules used = {3588, 78, 68} \[ \frac{(B (n+2)+i A (2-n)) (c-i c \tan (e+f x))^n \, _2F_1\left (2,n;n+1;\frac{1}{2} (1-i \tan (e+f x))\right )}{16 a^2 f n}+\frac{(-B+i A) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n)/(a + I*a*Tan[e + f*x])^2,x]

[Out]

((I*A*(2 - n) + B*(2 + n))*Hypergeometric2F1[2, n, 1 + n, (1 - I*Tan[e + f*x])/2]*(c - I*c*Tan[e + f*x])^n)/(1
6*a^2*f*n) + ((I*A - B)*(c - I*c*Tan[e + f*x])^n)/(4*a^2*f*(1 + I*Tan[e + f*x])^2)

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> -Simp[((b*e - a*f
)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(f*(p + 1)*(c*f - d*e)), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1)
+ c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f,
 n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || LtQ
[p, n]))))

Rule 68

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((b*c - a*d)^n*(a + b*x)^(m + 1)*Hype
rgeometric2F1[-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b^(n + 1)*(m + 1)), x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rubi steps

\begin{align*} \int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(A+B x) (c-i c x)^{-1+n}}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(i A-B) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2}+\frac{(c (A (2-n)-i B (2+n))) \operatorname{Subst}\left (\int \frac{(c-i c x)^{-1+n}}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=\frac{(i A (2-n)+B (2+n)) \, _2F_1\left (2,n;1+n;\frac{1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{16 a^2 f n}+\frac{(i A-B) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2}\\ \end{align*}

Mathematica [F]  time = 180.002, size = 0, normalized size = 0. \[ \text{\$Aborted} \]

Verification is Not applicable to the result.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n)/(a + I*a*Tan[e + f*x])^2,x]

[Out]

$Aborted

________________________________________________________________________________________

Maple [F]  time = 1.252, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( A+B\tan \left ( fx+e \right ) \right ) \left ( c-ic\tan \left ( fx+e \right ) \right ) ^{n}}{ \left ( a+ia\tan \left ( fx+e \right ) \right ) ^{2}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x)

[Out]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left ({\left (A - i \, B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, A e^{\left (2 i \, f x + 2 i \, e\right )} + A + i \, B\right )} \left (\frac{2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n} e^{\left (-4 i \, f x - 4 i \, e\right )}}{4 \, a^{2}}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

integral(1/4*((A - I*B)*e^(4*I*f*x + 4*I*e) + 2*A*e^(2*I*f*x + 2*I*e) + A + I*B)*(2*c/(e^(2*I*f*x + 2*I*e) + 1
))^n*e^(-4*I*f*x - 4*I*e)/a^2, x)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**n/(a+I*a*tan(f*x+e))**2,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (f x + e\right ) + A\right )}{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*(-I*c*tan(f*x + e) + c)^n/(I*a*tan(f*x + e) + a)^2, x)